package com.dingwen.treasure.influxdb.pojo;

import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.Instant;

/**
 * 物联网数据
 *
 * @author dingwen
 * @date 2023/01/09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Builder
@Measurement(name = "iot_data")
public class IotData implements Serializable {

    /**
     * 设备id
     */
    @Column(tag = true)
    private String deviceId;

    /**
     * 传感器id
     */
    @Column(tag = true)
    private String sensorId;

    /**
     * 原始数据
     */
    @Column
    private String data;

    /**
     * 数据创建时间：时间戳
     */
    @Column(timestamp = true)
    private Instant createTime;

    private static final long serialVersionUID = -4870867231838793496L;
}
